require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Prodoc
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
    # config.assets.paths << Rails.root.join('app', 'assets', 'fonts')

    config.active_record.default_timezone = :local  

    config.i18n.default_locale = 'zh'
    #config.i18n.default_locale = 'zh-CN'
    config.time_zone = 'Beijing'

    config.assets.precompile += %w( test.css )
    config.assets.precompile += %w( ie8-responsive-file-warning.js )
    config.assets.precompile += %w( respond.min.js html5shiv.js )
    config.assets.precompile += %w( Moxie.swf )
    config.assets.precompile += %w( Moxie.xap )
    config.assets.precompile += %w( jquery.plupload.queue/* )
    config.assets.precompile += %w( jquery.ui.plupload/* )

    config.action_mailer.default_url_options = { 
      :host => Rails.application.secrets.default_url_options_houst 
    }

    config.action_mailer.smtp_settings = {
    address: Rails.application.secrets.email_provider_address,
    port: 25,
    domain: Rails.application.secrets.domain_name,
    authentication: :login,
    enable_starttls_auto: true,
    user_name: Rails.application.secrets.email_provider_username,
    password: Rails.application.secrets.email_provider_password
  }
  # ActionMailer Config
  #config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = false

    #config.assets.precompile += %w( jquery.plupload.queue/buttons-disabled.png )
    #config.assets.precompile += %w( jquery.plupload.queue/transp50.png )
  end
end
